package self.example.explore.dao;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import self.example.explore.po.TblAccount;
import self.example.explore.po.TblAccountExample;

public interface TblAccountMapper {
    long countByExample(TblAccountExample example);

    int deleteByExample(TblAccountExample example);

    @Delete({
        "delete from tbl_account",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into tbl_account (id, name, ",
        "money)",
        "values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, ",
        "#{money,jdbcType=INTEGER})"
    })
    int insert(TblAccount row);

    int insertSelective(TblAccount row);

    List<TblAccount> selectByExample(TblAccountExample example);

    @Select({
        "select",
        "id, name, money",
        "from tbl_account",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("self.example.explore.dao.TblAccountMapper.BaseResultMap")
    TblAccount selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("row") TblAccount row, @Param("example") TblAccountExample example);

    int updateByExample(@Param("row") TblAccount row, @Param("example") TblAccountExample example);

    int updateByPrimaryKeySelective(TblAccount row);

    @Update({
        "update tbl_account",
        "set name = #{name,jdbcType=VARCHAR},",
          "money = #{money,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(TblAccount row);
}